package com.example.springboot.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.springboot.entity.Task;
import com.example.springboot.mapper.TaskMapper;
import com.example.springboot.service.TaskService;
import com.github.pagehelper.PageInfo;
import com.github.pagehelper.page.PageMethod;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 任务列表业务处理
 **/
@Service
public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements TaskService {

    @Resource
    private TaskMapper TaskMapper;

    /**
     * 分页查询
     */
    public PageInfo<Task> selectPage(Task Task, Integer pageNum, Integer pageSize) {
        PageMethod.startPage(pageNum, pageSize);
        List<Task> list = TaskMapper.selectAll(Task);
        return new PageInfo<>(list);
    }

}
